package com.jt.www.domain.enums.common;

import org.apache.commons.lang3.StringUtils;

/**
 * 推送状态
 * 1-未认领，2-认领成功，3-认领失败
 */
public enum ClaimStatusEnum {

    DEFAULT("1", "无认领信息"),
    SUCCESS("2", "认领成功"),
    ERROR("3", "认领失败");

    private String code;

    private String desc;

    ClaimStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return "";
        }
        for (ClaimStatusEnum pushStatusEnum : ClaimStatusEnum.values()) {
            if (pushStatusEnum.code.equals(code)) {
                return pushStatusEnum.desc;
            }
        }
        return "";
    }


    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}


